home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue24 / tiptrix / LISTING3.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-07-21  |  322 b   |  16 lines

  1. FUNCTION get_word_upto(wrkstr : STRING; delim : CHAR) :
  2.   STRING;
  3. VAR
  4.   i  : INTEGER;
  5.   found : BOOLEAN;
  6. BEGIN
  7.   found := FALSE;
  8.   i := 1;
  9.   REPEAT
  10.     INC(i);
  11.     IF wrkstr[i] = delim THEN found := TRUE;
  12.     IF i > LENGTH(wrkstr) THEN found := TRUE;
  13.   UNTIL found;
  14.   result := COPY(wrkstr, 1, i - 1);
  15. END;
  16.